package com.example.userregister;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
    private EditText etAct,etPwd;
    private Button reBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        reBtn = findViewById(R.id.register_btn);
        etAct = findViewById(R.id.et_act1);
        etPwd = findViewById(R.id.et_pwd1);

        reBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                passwordData();
            }
        });
    }

    private void passwordData() {
        //先创建意图
        Intent intent = new Intent(this,ShowActivity.class);
        //把数据存入intent
        intent.putExtra("account",etAct.getText().toString().trim());
        intent.putExtra("password",etPwd.getText().toString().trim());
        //开启意图
        startActivity(intent);
    }
}
